/*
 * author Vdaras
 */


#ifndef GLOBALTIMER_H
#define	GLOBALTIMER_H

#include "Singleton.h"
#include "sdl/Timer.h"


/**
 * Class that encapsulates the engines time data.
 */
class GlobalTimer : public Singleton< GlobalTimer >
{
private:
    Uint32 m_lastUpdate;
    Uint32 m_delta;

public:

    ~GlobalTimer();

    /**
     * Notifies the Global Timer that a new frame has started
     */

    void MarkFrameStart();


    /**
     * @return how much time has passed since the last frame.
     */

    Uint32 GetDeltaTime();

protected:
    friend class Singleton< GlobalTimer >;

    GlobalTimer();
};

#endif	/* GLOBALTIMER_H */

